<?php

namespace App\Models\Fund;

use App\Models\BaseModel;

/**
 * 资金账户
 *
 * Class CurrencyFreezeLog
 * @package App\Models\Fund
 */
class CurrencyFreezeLog extends BaseModel
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'currency_freeze_log';

    /**
     * Indicates if the model should be timestamped.
     * @var bool
     */
    public $timestamps = false;


    public $appends = ['status_text','type_text','freeze_status_text'];
    public $freezeStatusText = ['0'=>'未全解冻', '1'=>'已全解冻'];
    public $typeText = ['goods'=>'商品', 'certificate'=>'证书', 'order'=>'订单', 'system'=>'系统'];
 
    public function getTypeTextAttribute()
    {
        return $this->typeText[$this['type']];
    }

    public function getFreezeStatusTextAttribute()
    {
        return $this->freezeStatusText[$this['freeze_status']];
    }

    public function getUserInfoAttribute($value)
    {
        return json_decode($value, true);
    }
   
    public function getOppositeInfoAttribute($value)
    {
        return json_decode($value, true);
    }

}
